 (i) Prove that the implementations of these functions are memory-safe/crash free and always terminate. 